package com.bw.documents.preview

import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.bw.documents.databinding.ActivityPdfBinding
import java.io.File

@Route(path = "/documents/PDFActivity")
class PDFActivity : AppCompatActivity() {

    private val v : ActivityPdfBinding by lazy { ActivityPdfBinding.inflate(LayoutInflater.from(this)) }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(v.root)
        val path = intent.extras!!.getString("path")
        v.pdfPage.backImg.setOnClickListener { finish() }
        v.pdfPage.titleTv.text = "PDF预览"
        v.pdfView.fromFile(File(path))
            .load()

    }

}